﻿<%@ Page Title="Part - Goods Issue" Language="C#" MasterPageFile="~/Main.Master"
    AutoEventWireup="true" CodeBehind="GoodsIssue.aspx.cs" Inherits="VSM.Parts.GoodsIssue" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">


        function OpenItemPopup() {
            var url = "../../../ItemPartPopup.aspx?itmgrp=102";
            Main.openCustomDialog(url, 600, 610, "Parts List");
        }

        function OpenBP() {
            var url = "../../../BPPopup.aspx?CardType=S";
            Main.openCustomDialog(url, 600, 610, "Business Partner List");
        }

        function OpenDocList(docktype, title) {
            var url = "../../../DocumentList.aspx?DocType=" + docktype
            Main.openCustomDialog(url, 800, 610, title);
        }
    </script>
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:HiddenField ID="hdnIsUpdate" runat="server" />
                <asp:HiddenField ID="hdnStatus" runat="server" />
                <h2>
                    &nbsp;<asp:Label ID="lblTitle" runat="server" Text="Part - Goods Issue"></asp:Label>
                </h2>
                <div style="margin-left: 5px; width: 99%;">
                    <hr />
                    <table border="0" width="100%" style="background-color: #D1D4D8; font-weight: bold;">
                        <tr>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 100px;">
                                Document ID:
                            </td>
                            <td style="width: 150px">
                                <asp:TextBox ID="txtDocNo" runat="server" BackColor="#E6E6E6" ReadOnly="True" Width="122px"></asp:TextBox>
                            </td>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 100px;">
                                Doc. Date:
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtDocDate" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Format="dd/MM/yyyy" PopupButtonID="imgDocDate"
                                    TargetControlID="txtDocDate">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgDocDate" runat="Server" AlternateText="Click to show calendar"
                                    ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                            <td align="right">
                                <asp:Button ID="btnDocList" runat="server" OnClientClick="OpenDocList('59', 'Goods Issue List'); return false;"
                                    Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;"
                                    Text="List" Width="60px" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td>
                            </td>
                            <td style="border-bottom: dotted 1px #808080; vertical-align: bottom; width: 150px;">
                                Posting Date:
                            </td>
                            <td colspan="2">
                                <asp:TextBox ID="txtPostingDate" runat="server"></asp:TextBox>
                                <cc1:CalendarExtender ID="txtPostingDate_CalendarExtender" runat="server" Format="dd/MM/yyyy"
                                    PopupButtonID="imgPostingDate" TargetControlID="txtPostingDate">
                                </cc1:CalendarExtender>
                                <asp:ImageButton ID="imgPostingDate" runat="Server" AlternateText="Click to show calendar"
                                    ImageUrl="~/Images/Calendar_scheduleHS.png" />
                            </td>
                        </tr>
                    </table>
                    <table id="Table1" width="100%" style="font-weight: bold">
                        <tr>
                            <td class="FormLineItemAlt" valign="middle">
                                <asp:Button ID="btnAddItems0" runat="server" OnClientClick="OpenItemPopup(); return false;"
                                    Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;"
                                    Text="Add new item" Width="110px" />
                                <asp:Button ID="btnGetTemplate" runat="server" OnClick="btnGetTemplate_Click" Style="background-image: url('/Images/bgButton.png');
                                    background-repeat: no-repeat;" Text="Get Template" Width="90px" Visible="False" />
                                <asp:FileUpload ID="FileUploadControl" runat="server" Visible="False" />
                                <asp:Button ID="btnImport" runat="server" OnClick="btnImport_Click" Style="background-image: url('/Images/bgButton.png');
                                    background-repeat: no-repeat;" Text="Import" Width="60px" Visible="False" />
                            </td>
                        </tr>
                    </table>
                    <hr />
                    <div style="width: 100%">
                        <asp:GridView ID="grvGRPT" CssClass="GridInner" runat="server" Width="100%" BorderColor="White"
                            BackColor="White" AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
                            HeaderStyle-Height="27px" OnRowCreated="grvGRPO_RowCreated" CellSpacing="2" OnRowEditing="EditItem"
                            OnRowUpdating="UpdateItem" HeaderStyle-VerticalAlign="Middle" OnRowCancelingEdit="CancelEdit"
                            AllowPaging="True" OnPageIndexChanging="grvSearchResult_PageIndexChanging" PageSize="20"
                            OnRowDeleting="DeleteItem" OnRowDataBound="grvSearchResult_RowDataBound">
                            <PagerSettings Mode="NumericFirstLast" />
                            <PagerStyle BackColor="#70A0D0" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Middle" />
                            <RowStyle BackColor="#D9E0ED" BorderColor="White" BorderWidth="2px" Height="25px" />
                            <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" />
                            <Columns>
                                <asp:CommandField HeaderText="Action" ShowDeleteButton="True" ShowEditButton="False"
                                    Visible="false" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                                    ItemStyle-Width="70px" />
                                <asp:TemplateField HeaderText="Action">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lnkDelete" runat="server" Text="Delete" TabIndex="-1" OnClick="lnkDelete_Click"></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="#">
                                    <ItemStyle HorizontalAlign="Center" Width="20px" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblNo" runat="server" Text='<%# Bind("No") %>' BorderStyle="none">
                                        </asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Item Code">
                                    <ItemStyle HorizontalAlign="Center" />
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblItemCode" runat="server" Text='<%# Bind("ItemCode") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Item Name">
                                    <ItemStyle HorizontalAlign="left" />
                                    <HeaderStyle VerticalAlign="Middle" Font-Bold="true" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblItemName" runat="server" Text='<%# Bind("Dscription") %>' BorderStyle="none" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:TemplateField HeaderText="UoM">
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblUoM" runat="server" Text='<%# Bind("unitMsr") %>' BorderStyle="none" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Model" >
                                    <HeaderStyle VerticalAlign="Middle" />
                                    <ItemStyle HorizontalAlign="Center" />
                                    <ItemTemplate>
                                        <asp:Label ID="lblModel" runat="server" Text='<%# Bind("U_Model") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Order Qty.">
                                    <ItemStyle HorizontalAlign="Right" />
                                    <HeaderStyle VerticalAlign="Middle" Width="80px" />
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtOrderQuantity" Style="text-align: right" runat="server" Width="97%"
                                            Text='<%# Bind("Quantity")%>' AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);"
                                            OnTextChanged="txtOrderQuantity_OnTextChanged" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle BackColor="#6095C9" ForeColor="#ffffff" Font-Overline="False" Height="27px"
                                VerticalAlign="Middle" HorizontalAlign="Center" />
                            <EmptyDataTemplate>
                                <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all"
                                    cellspacing="2" cellpadding="2">
                                    <tr valign="middle" style="height: 27px; color: white; text-decoration: none; background-color: rgb(96, 149, 201);
                                        text-align: center;">
                                        <th>
                                            <span>Action</span>
                                        </th>
                                        <th>
                                            <span>#</span>
                                        </th>
                                        <th>
                                            <span>Item Code</span>
                                        </th>
                                        <th>
                                            <span>Item Name</span>
                                        </th>
                                        <th>
                                            <span>UoM</span>
                                        </th>
                                        <th>
                                            <span>Model</span>
                                        </th>
                                        <th>
                                            <span>Order Qty.</span>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td colspan="6">
                                            <span>No Data</span>
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                        </asp:GridView>
                    </div>
                    <hr width="100%" />
                </div>
                <table width="100%" border="0">
                    <tr>
                        <td valign="top" style="width: 70%;">
                            <table style="width: 100%;">
                                <tr>
                                    <td style="width: 10%;">
                                        <strong>Remarks:</strong>
                                    </td>
                                    <td style="width: 40%;">
                                        <asp:TextBox runat="server" ID="txtRemarks" Height="71px" Style="width: 98%;" TextMode="MultiLine"></asp:TextBox>
                                    </td>
                                    <td style="width: 50%;">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <div style="margin-left: 5px; width: 99%;">
                                <hr />
                            </div>
                            <table style="width: 100%">
                                <tr>
                                    <td style="width: 250px;">
                                        <asp:Button ID="btnSave" runat="server" Text="Save" Style="background-image: url('/Images/bgButton.png');
                                            background-repeat: no-repeat; color: White;" OnClick="btnSave_Click" BorderStyle="Solid"
                                            Width="60px" />
                                        <asp:Button ID="btnCancel" runat="server" Text="Cancel" Style="background-image: url('/Images/bgButton.png');
                                            background-repeat: no-repeat; color: White;" OnClick="btnCancel_Click" BorderStyle="Solid"
                                            Width="60px" />
                                        <asp:Button ID="btnPrint" runat="server" BorderStyle="Solid" Style="background-image: url('/Images/bgButton.png');
                                            background-repeat: no-repeat; color: White;" Text="Print" Width="60px" />
                                        <asp:Button ID="btnLastRecord" runat="server" BorderStyle="Solid" OnClick="btnLastRecord_Click"
                                            Style="background-image: url('/Images/bgButton.png'); background-repeat: no-repeat;
                                            color: White;" Text="&gt;&gt;" Width="40px" />
                                    </td>
                                    <td colspan="2">
                                        <asp:Label ID="lblError" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="btnImport" />
                <asp:PostBackTrigger ControlID="btnGetTemplate" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
</asp:Content>
